<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>音乐首页</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: Arial, sans-serif;
            background-color: #f5f5f5;
        }
        
        .header {
            background-color: #fff;
            padding: 15px 50px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }
        
        .logo {
            color: #42b983;
            font-size: 24px;
            font-weight: bold;
        }
        
        .nav {
            display: flex;
            gap: 30px;
        }
        
        .nav a {
            color: #666;
            text-decoration: none;
            font-size: 16px;
        }
        
        .nav a:hover {
            color: #42b983;
        }
        
        .search-box {
            border: 1px solid #ddd;
            padding: 5px 15px;
            border-radius: 20px;
            width: 300px;
        }
        
        .user-actions {
            display: flex;
            gap: 15px;
            align-items: center;
        }
        
        .btn {
            padding: 8px 20px;
            border-radius: 5px;
            cursor: pointer;
        }
        
        .btn-vip {
            background-color: #42b983;
            color: white;
            border: none;
        }
        
        .main-content {
            padding: 30px 50px;
        }
        
        .section-title {
            font-size: 24px;
            color: #333;
            margin-bottom: 20px;
        }
        
        .music-grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 20px;
            margin-top: 20px;
        }
        
        .music-card {
            background: white;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }
        
        .music-card img {
            width: 100%;
            height: 200px;
            object-fit: cover;
        }
        
        .music-info {
            padding: 10px;
        }
        
        .music-title {
            font-size: 14px;
            color: #333;
            margin-bottom: 5px;
        }
        
        .play-count {
            font-size: 12px;
            color: #999;
        }
        
        .category-nav {
            display: flex;
            gap: 20px;
            margin-bottom: 20px;
        }
        
        .category-nav a {
            color: #666;
            text-decoration: none;
            font-size: 14px;
        }
        
        .category-nav a:hover {
            color: #42b983;
        }
    </style>
</head>
<body>
    <div class="header">
        <div class="logo">音乐馆</div>
        <div class="nav">
            <a href="#">个人中心</a>
            <a href="#">我的收藏</a>
            <a href="#">听歌记录</a>
            <a href="#">后台管理</a>
        </div>
        <input type="text" class="search-box" placeholder="搜索音乐">

        <div class="nav-right">
            <% if (session.getAttribute("user") == null) { %>
                <a href="login.jsp" class="btn btn-login">登录</a>
                <a href="register.jsp" class="btn btn-register">注册</a>
            <% } else { %>
                <a href="vip.jsp" class="btn btn-vip">开通会员</a>
                <a href="LogoutServlet" class="btn btn-logout">退出登录</a>
            <% } %>
        </div>
    </div>
    
    <div class="main-content">
        <h2 class="section-title">歌单推荐</h2>
        <div class="category-nav">
            <a href="#">为你推荐</a>
            <a href="#">经典榜单</a>
            <a href="#">欧美榜单</a>
            <a href="#">官方歌单</a>
            <a href="#">抖音热门</a>
        </div>
        
        <div class="music-grid">
            <div class="music-card">
                <img src="https://via.placeholder.com/200" alt="音乐封面">
                <div class="music-info">
                    <div class="music-title">那些好听却知名度不高的歌曲合集</div>
                    <div class="play-count">播放量：331万</div>
                </div>
            </div>
            <div class="music-card">
                <img src="https://via.placeholder.com/200" alt="音乐封面">
                <div class="music-info">
                    <div class="music-title">8090后专属怀旧金曲合集</div>
                    <div class="play-count">播放量：56万</div>
                </div>
            </div>
            <div class="music-card">
                <img src="https://via.placeholder.com/200" alt="音乐封面">
                <div class="music-info">
                    <div class="music-title">欧美节奏性强的欧美歌曲</div>
                    <div class="play-count">播放量：51万</div>
                </div>
            </div>
            <div class="music-card">
                <img src="https://via.placeholder.com/200" alt="音乐封面">
                <div class="music-info">
                    <div class="music-title">自习氛围乐|静静学习中</div>
                    <div class="play-count">播放量：99万</div>
                </div>
            </div>
            <div class="music-card">
                <img src="https://via.placeholder.com/200" alt="音乐封面">
                <div class="music-info">
                    <div class="music-title">听听心情会变好，有点治愈的轻音乐</div>
                    <div class="play-count">播放量：139万</div>
                </div>
            </div>
        </div>
    </div>
    
    <div class="online-count" style="
        position: fixed;
        left: 20px;
        bottom: 20px;
        background-color: rgba(66, 185, 131, 0.8);
        color: white;
        padding: 10px 20px;
        border-radius: 20px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        font-size: 14px;">
        当前在线人数：${applicationScope.onlineCount}
    </div>
</body>
</html> 